Fix occasional build failures with shared GitInfo.cache under parallel builds (#390)#393
Merged
Conversation
…el builds (#390) When using a shared \ (e.g. solution-level obj/) with msbuild /m, multiple projects can race on clearing/writing GitInfo.cache, leading to MSB3491 'file is being used by another process'. - Add ContinueOnError=true to Delete (clear), MakeDir, and WriteLinesToFile for the shared cache (consistent with prior race fixes for IsDirty.cache and read paths). - This makes the write failure non-fatal; one concurrent writer succeeds, values are already computed in-memory for all, and the marker is updated. - Updated changelog. Fixes #390
1630909 to
c2fb8e1
Compare
This was referenced Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using a shared
$(GitCachePath)(e.g. solution-levelobj/) withmsbuild /m,multiple projects can race on clearing/writing
GitInfo.cache, leading toMSB3491: Could not write lines to file ... The process cannot access the file because it is being used by another process.ContinueOnError="true"toDelete(in_GitClearCacheand skip-read),MakeDir, andWriteLinesToFile(in_GitWriteCache)for the shared cache files (consistent with prior race fixes for
IsDirty.cacheand read paths, see Weird race condition with targets #321).values are already computed in-memory for all projects, and the up-to-date marker is updated.
Fixes #390